package _Pan3D.program.shaders
{
	import _Pan3D.program.Shader3D;
	
	public class ZhuanQuanShader extends Shader3D
	{
		public static var ZHUANQUAN_SHADER:String = "ZHUANQUAN_SHADER";
		public function ZhuanQuanShader()
		{
			vertex = 
				"mov vt0,va0 \n"+
				"mov vt2,vc8 \n"+
				"mov vt4,va2 \n"+
				
				
				
				
               "add vt2.y,vt2.y,va2.y \n"+
               "add vt2.z,vt2.z,va2.z \n"+
			   
			   
			   "sin vt5.x,vt2.y \n"+
			   "cos vt5.y,vt2.y \n"+
			   
			   "mov vt5.z,vt0.x \n"+
			   "mul vt6.x,vt5.y,vt5.z \n"+
			   "mul vt6.y,vt5.x,vt0.z \n"+
			   "sub vt0.x,vt6.x,vt6.y \n"+
			   
			   "mul vt6.x,vt5.x,vt5.z \n"+
			   "mul vt6.y,vt5.y,vt0.z \n"+
			   "add vt0.z,vt6.x,vt6.y \n"+
			   
			   
			   
				
			   "sin vt5.x,vt2.z \n"+
			   "cos vt5.y,vt2.z \n"+
			   
			   "mov vt5.z,vt0.x \n"+
			   "mul vt6.x,vt5.y,vt5.z \n"+
			   "mul vt6.y,vt5.x,vt0.y \n"+
			   "sub vt0.x,vt6.x,vt6.y \n"+
			   
			   "mul vt6.x,vt5.x,vt5.z \n"+
			   "mul vt6.y,vt5.y,vt0.y \n"+
			   "add vt0.y,vt6.x,vt6.y \n"+
			   


				
				"m44 vt0,vt0, vc4 \n" +
				"m44 vt0, vt0, vc0 \n" +
				"mov op, vt0 \n" +
				"mov v0, va1";
			fragment =

				"tex ft0, v0, fs0 <2d,clamp,repeat>\n"+
				"mul ft0,ft0,fc0.x \n"+
				"mov oc, ft0";
		}
	}
}